<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  console.log( navigator )
  console.log( window.navigator )
  console.log( window.navigator === navigator )
  
  console.log( navigator.userAgent );

  if(navigator.userAgent.indexOf("Chrome") !== -1){
    console.log("Chrome浏览器");
  }else if(navigator.userAgent.indexOf("Firefox") !== -1){
    console.log("Firefox浏览器");
  }else if(navigator.userAgent.indexOf("Safari") !== -1){
    console.log("Safari浏览器");
  }

  // "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"

  // "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:107.0) Gecko/20100101 Firefox/107.0"

  // "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15"

</script>
</html>